package com.codeduck.properties.byJava;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @auther Mahone Yan
 * @date 2023/5/5
 */
public enum ZookeeperProperties {
    INSTANCE;
    private Properties props = new Properties();

    ZookeeperProperties() {
        InputStream inputStream = ZookeeperProperties.class.getClassLoader().getResourceAsStream("META-INF/zookeeper.properties");
        try {
            props.load(inputStream);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public static Properties getProperties() {
        return ZookeeperProperties.INSTANCE.props;
    }
}
